package com.zyx.javademo.enumdemo;

/**
 * @author Yaxi.Zhang
 * @since 2021/6/29 12:10
 * desc: 颜色枚举类
 */
enum Color {
    /*
     * 等价于:
     * class Color {
     *      public static final Color RED = new Color();
     *      public static final Color BLUE = new Color();
     *      public static final Color GREEN = new Color();
     * }
     */
    RED, GREEN, BLUE;

    /**
     * 构造函数
     */
    Color() {
        System.out.println("Constructor called for : " + this.toString());
    }

    public void colorInfo() {
        System.out.println("Universal Color");
    }
}
